package voja.android.log;

import java.util.Date;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.view.View;
import android.widget.TextView;

public class ExpandableFilter extends Activity {
	private String[] groups = { "People Names", "Dog Names", "Cat Names", "Fish Names" };
    private String[][] children = {
            { "Arnold", "Barry", "Chuck", "David" },
            { "Ace", "Bandit", "Cha-Cha", "Deuce" },
            { "Fluffy", "Snuggles" },
            { "Goldy", "Bubbles" }
    };
    
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.settings);
        
        // init Back Button
        TextView btnBack = (TextView)findViewById(R.id.btnBack);
		btnBack.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});
        
        Bundle extras = getIntent().getExtras();
        TextView opt = (TextView)findViewById(R.id.txtOptions);
        if(extras!=null){
        	Long date_first_ts = Long.parseLong(extras.getString("date_first"));
        	Long date_last_ts = Long.parseLong(extras.getString("date_last"));
        	
        	Date date_first = new Date();
        	Date date_last = new Date();
        	
        	date_first.setTime(date_first_ts);
        	date_last.setTime(date_last_ts);
        	
        	opt.setText(DateFormat.format("dd.MMM yyyy", date_first));
        }
    }
}
